#include <stdio.h>
#include <stdlib.h>
void main()
{
    /* 
    int time[7];//define 7 :time[0,1,2,3...6]
    for (int i = 0; i < 7; i++)//输入七个变量值
    {
       printf("please enter time[%d]: ", i);
       scanf("%d",&time[i]);
       printf("time[%d]=%d\n", i,time[i]);
    }
    printf("time[0]=%d,time[1]=%d, time[2]=%d,time[3]=%d,time[4]=%d, time[5]=%d,time[6]=%d\n",time[0],time[1],time[2],time[3],time[4], time[5],time[6]);

    //冒泡排序
    int temp;
    for (int i = 0; i < 7; i++)
    {
        for (int j = i+1; j < 7; j++)
        {
            if (time[i] >time[j])//比较大小
            {
                temp=time[j];
                time[j]=time[i];
                time[i]=temp;
            }
        }  
    }
    printf("time[0]=%d,time[1]=%d, time[2]=%d,time[3]=%d,time[4]=%d, time[5]=%d,time[6]=%d\n",time[0],time[1],time[2],time[3],time[4], time[5],time[6]); 
    */


    int a[5]={5,2,9,11,4};
    int i=0;
    int temp;
    for ( i = 0; i < 5; i++)
    {
        for ( int j = i+1;j<5; j++)
        {
            if (a[i]>a[j])
            {
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
            
        }
        
    }
    
    for ( i = 0; i < 5; i++)
    {              
        printf("a[i]=%d\n",a[i]);
    }
    
    system("pause");
    return 0;
}